<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>KRY会议室管理系统</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="format-detection" content="telephone=no">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="alternate icon" type="image/png" href="amazeui/assets/i/favicon.png">
<link rel="stylesheet" href="amazeui/assets/css/amazeui.min.css" />
<style>

.header {
	text-align: center;
}

.header h1 {
	font-size: 200%;
	color: #333;
	margin-top: 30px;
}

.header p {
	font-size: 14px;
}

.divcenter {
	text-align: center;
}

.am-g .loginflag {
	line-height: 3em;
	MARGIN-RIGHT: auto;
	MARGIN-LEFT: auto;
	TEXT-ALIGN: center;
	width: 35%;
}

.loginflag h3 {
	font-size: 150%;
	color: #333;
	margin-top: 16px;
}
</style>
</head>




<body>
	<div class="header">
		<div class="am-g">
			<h1>KRY会议室预定管理系统</h1>
			<p>热爱生活，团队制胜，快学快用，超越极致</p>
		</div>
		<hr />
	</div>
	<div class="am-g">
		<div class="am-u-lg-4 am-u-md-8 am-u-sm-centered">
			<div class="loginflag">
				<span class="am-comment-avatar"><i class="am-icon-user am-icon-btn"></i></span>
				<h3>用户登录</h3>
			</div>
			<br>
			<div class="divcenter">
				<span id="msg"></span>
			</div>
			<!-- 
    <hr>
    <div class="am-btn-group">
      <a href="#" class="am-btn am-btn-secondary am-btn-sm"><i class="am-icon-github am-icon-sm"></i> Github</a>
      <a href="#" class="am-btn am-btn-success am-btn-sm"><i class="am-icon-google-plus-square am-icon-sm"></i> Google+</a>
      <a href="#" class="am-btn am-btn-primary am-btn-sm"><i class="am-icon-stack-overflow am-icon-sm"></i> stackOverflow</a>
    </div>
    -->

			<!--  <form method="post" class="am-form" action="/login/logon" >-->
			<form method="post" class="am-form">
				<label for="email">邮箱:</label> <input type="email" name="email" id="email"
					value=""> <br> <label for="password">密码:</label> <input
					type="password" name="pwd" id="password" value=""> <br> <label
					for="remember-me"> <input id="remember-me" type="checkbox">
					记住密码
				</label> <br />
				<div class="am-cf">
					<!--   <input type="submit" id="loginBut" name="" value="登 录" class="am-btn am-btn-primary am-btn-sm am-fl" > -->
					<input type="button" id="loginBut" name="" value="登 录"
						class="am-btn am-btn-primary am-btn-sm am-fl" onclick="login()"> <input
						type="submit" id="getPwd" name="" value="忘记密码 ^_^? "
						class="am-btn am-btn-default am-btn-sm am-fr" onclick="getPwd()">
				</div>
			</form>
			<hr>
			<p>© 2016 By Kry.AlbertPan</p>
		</div>
	</div>


	<!--[if lt IE 9]>
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="/amazeui/assets/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->

	<!--[if (gte IE 9)|!(IE)]><!-->
	<script src="amazeui/assets/js/jquery.min.js"></script>
	<!--<![endif]-->
	<script src="amazeui/assets/js/amazeui.min.js"></script>
	<script src="amazeui/assets/js/app.js"></script>
</body>

<script type="text/javascript">
	function load() {
		//下面几种方法效果是一样的  
		//document.getElementById("loginBut").onclick();  
		//document.getElementById("loginBut").click();  
		$("#loginBut").click();
	}

	function getPwd() {

	}

	function login() {
		$.ajax({
			//提交数据的类型 POST GET
			type : "POST",
			//提交的网址
			url : "/mbs/login/logon",
			//提交的数据
			data : {
				email : $("#email").val(),
				pwd : $("#password").val()
			},

			//返回数据的格式
			datatype : "json",//"xml", "html", "script", "json", "jsonp", "text".
			//在请求之前调用的函数
			beforeSend : function() {
				$("#msg").html("login1...");
			},
			//成功返回之后调用的函数            
			success : function(data) {
				$("#msg").html("logon");
				var code = data.code;
				if (code == 1) {
					window.location.href = "amazeui/admin-index.html";
				} else {
					var msg = data.msg;
					$("#msg").html(decodeURI(msg));
					$("#msg").css("color", "red");
				}
			},
			//调用执行后调用的函数
			/* complete: function(XMLHttpRequest, textStatus){
			    alert(XMLHttpRequest.responseText);
			    alert(textStatus);
			     //HideLoading();
			 },*/
			//调用出错执行的函数
			error : function() {
				//请求出错处理
			}
		});
	}
</script>
</html>
